package com.system.healthproject.mapper;

import com.system.healthproject.bean.*;
import com.system.healthproject.bean.web.ResultAllPatient;
import com.system.healthproject.bean.web.ResultDoctorGroup;
import com.system.healthproject.bean.web.ResultDoctorInfo;
import com.system.healthproject.bean.web.UpdateDoctorInfo;
import com.system.healthproject.model.sickuser.params.UserDoctorsItem;
import com.system.healthproject.pojo.Consulting;
import com.system.healthproject.pojo.Doctor;
import com.system.healthproject.pojo.Transaction;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface DoctorMapper {

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table doctor
     *
     * @mbg.generated
     */
    int deleteByPrimaryKey(Integer doctorId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table doctor
     *
     * @mbg.generated
     */
    int insert(Doctor record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table doctor
     *
     * @mbg.generated
     */
    int insertSelective(Doctor record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table doctor
     *
     * @mbg.generated
     */
    Doctor selectByPrimaryKey(Integer doctorId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table doctor
     *
     * @mbg.generated
     */
    int updateByPrimaryKeySelective(Doctor record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table doctor
     *
     * @mbg.generated
     */
    int updateByPrimaryKey(Doctor record);

    /**
     * 添加医生信息
     * @param parameterDoctor
     * @return
     */
    int addDoctor(ParameterDoctor parameterDoctor);

    /**
     * 修改信息
     * @param paramterUpdateDoctorInfo
     * @return
     */
    int updateDoctor(ParamterUpdateDoctorInfo paramterUpdateDoctorInfo);

    /*
    String selectById(ParamterUpdateDoctorInfo paramterUpdateDoctorInfo);*/


    Integer addDoctorId(Doctor doctor);


    /**
     * 查询所有医生交易记录
     * @param currentPage
     * @param limit
     * @return
     */
    List<ResultDoctorTransaction> selectDoctorTransaction(Integer currentPage, Integer limit);

    int eliminate(Integer loginId, Double walnutCoinNumber);

    Integer addDoctorTransaction(Transaction transaction);

    Double selectSurplus(Integer loginId);

    /**
     * 统计所有医生交易记录数据条数
     * @return
     */
    Integer countDoctorTransaction();

    List<ResultDoctor> selectDoctor(ParamSelectDoctor  paramSelectDoctor);

    Integer countDoctor(ParamSelectDoctor paramSelectDoctor);

    ResultDoctorInfo selectDoctorInfo(Integer loginId);

    int updateDoctorInfo(UpdateDoctorInfo updateDoctorInfo);

    com.system.healthproject.bean.ResultDoctorInfo selectDoctorInformation(Integer doctorId);

    List<ResultDoctorConsulting> selectDoctorConsulting(Integer doctorId, String year, String mon, String day);

    int stopStartUp(@Param("doctorId") Integer doctorId,@Param("state") Integer state);

    Integer selectDoctorId(Integer loginId);

    List<ResultDoctorGroup> selectDoctorGroup(Integer doctorId);

    DoctorInfo selectDoctorByLoginId(Integer doctorId);

    List<ResultAllPatient> selectAllPatient(Integer doctorId);

    List<Integer> selectGroupIdPatient(Integer groupId);

    Integer addConsulting(Consulting consulting);

    Integer addConsultingRemindPatient(@Param("consultingId") Integer consultingId,
                                       @Param("groupIdPatientList") List<Integer> groupIdPatientList);

    Integer addConsultingRemindPatient2(@Param("consultingId")Integer consultingId,
                                        @Param("patientId")List<Integer> patientId);

    List<UserDoctorsItem> doctorsList(
            @Param("patientId") Integer patientId,
            @Param("isFollow") Integer isFollow);

    int userFollowDoctor(
            @Param("loginId") Integer loginId,
            @Param("doctorId") Integer doctorId,
            @Param("date") Date date);

    List<HospitalDoctorResultBean> selectHospitalAndDoctor();

    List<Doctor> selectrdepIdAllDoctor(Integer departmentId);

    String selectDoctorNameById(@Param("doctorId") Integer doctorId);
}
